package com.study.example.threadLocal;

/**
 * @author 贺瑞杰
 * @version V1.0
 * @date 2018-07-15 19:41
 * @description
 */
public class RequestHolder {

    private static final ThreadLocal<Long> requestHolder = new ThreadLocal<>();

    public static void add(Long id) {
        requestHolder.set(id);
    }

    public static Long getId() {
        return requestHolder.get();
    }

    public static void remove() {
        requestHolder.remove();
    }
}
